package com.thinkfit.jy.fragment;

import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.view.View;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.common.lib.constant.EventBusEvent;
import com.common.lib.fragment.BaseFragment;
import com.common.lib.manager.DataManager;
import com.common.lib.mvp.contract.EmptyContract;
import com.common.lib.mvp.presenter.EmptyPresenter;
import com.thinkfit.jy.R;
import com.thinkfit.jy.activity.BrandInfoActivity;
import com.thinkfit.jy.activity.VersionActivity;
import com.thinkfit.jy.utils.DeviceTypeUtils;

import org.greenrobot.eventbus.EventBus;

import java.util.HashMap;

/**
 * 关于界面
 */
public class BrandInfoFragment extends BaseFragment<EmptyContract.Presenter> implements EmptyContract.View {

    @NonNull
    @Override
    protected EmptyContract.Presenter onCreatePresenter() {
        return new EmptyPresenter(this);
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_brand_info;
    }

    @Override
    protected void initView(@NonNull View view, @Nullable Bundle savedInstanceState) {
        setViewsOnClickListener(R.id.ll_sport_back);
//        setImage(R.id.ivAutoUpdateSwitch, DataManager.Companion.getInstance().getIsAutoUpdate() ?
//                R.drawable.app_switch_on : (DataManager.Companion.getInstance().getMainStyle() == 3 ? R.drawable.app_switch_off_xm : R.drawable.app_switch_off));


    }

    @Override
    public void onStop() {
        super.onStop();
        DeviceTypeUtils.showBackButton(getContext().getApplicationContext());
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.ll_sport_back:
                HashMap<String, Object> map = new HashMap<>();
                map.put(EventBusEvent.TO_FRAGMENT,3);
                EventBus.getDefault().post(map);
                break;

        }
    }
}
